
import React from "react";
import { createContext, useContext } from "react";
import type EditorEnvironment from "src/dodoco/editor/EditorEnvironment";

const editorEnvContext = createContext(null);

export function EditorEnvContextProvider({ env, children }) {
    return (
        <editorEnvContext.Provider value={env}>
            {children}
        </editorEnvContext.Provider>
    )
}

export function getEditorEnvironment(): EditorEnvironment {
    return useContext(editorEnvContext);
}